package com.ldzy.service.impl;

import com.ldzy.mapper.BookMapper;
import com.ldzy.mapper.UserMapper;
import com.ldzy.pojo.User;
import com.ldzy.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    public User login(User user) {
        User user1=userMapper.getUserByUserCode(user.getUserCode());
        if (user1.getUserPassword().equals(user.getUserPassword()))//查询数据库，用户名和密码正确
            return user1;
        return null;
    }
}
